﻿using System;
using System.Data;
using System.ServiceModel;
using DM4;

namespace App_Code
{
    /// <summary>
    /// Summary description for Consts
    /// </summary>
    public static class CommonVars
    {
        public const string LoginPageTitle = "DM4WebClient Login";
        public const string DefaultPageTitle = "DM4WebClient";
        public const string LoginPageRelUrl = "~/Pages/Account/Login.aspx";
        public const string DefaultPageRelUrl = "~/Default.aspx";

        public const string UserId = "userid";
        public const string Login = "login";
        public const string Password = "password";
        public const string EndpointAddress = "endpointaddress";
        public const string EndpointServerName = "endpointservername";

        public static ChannelFactory<IDM4> Dm4ChannelFactory;
        public static IDM4 Dm4Srv;
        public static string LastError = "";

        /// <summary>
        /// UserInfo - user description
        /// </summary>
        //public static UserInfo Ui;

        /// <summary>
        /// GlobalInfo - server description
        /// </summary>
        public static GlobalInfo Gi;

        /// <summary>
        /// UserInfoList - available users (for view, edit sessins list) 
        /// </summary>
        //public static UserInfoList Uil;

        /// <summary>
        /// GroupInfoList - available group list
        /// </summary>
        public static GroupInfoList Gil;

        public static DataSet GroupInfods;

        public static int SelectedUid = -1;
        public static string WebConfigServerNamesSection = "ServerNames";
    }

    public static class StringMessages
    {
        public const string InvalidUserPass = "Invalid login or password.";
        public const string ErrorOfCreateServerChannel = "Unable to create server channel.";
        public const string ErrorOfGetServerList = "Unable to get server names list.";

        public const string ServerNameRequirement = "Server Name is required.";
        public const string UserNameRequirement = "User Name is required.";
        public const string PasswordRequirement = "Password is required.";
    }
}

